<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>

	<head>
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
		<title>JSP Page</title>
		<link rel="stylesheet" type="text/css" href="css/content.css" />
		<link rel="stylesheet" type="text/css" href="css/paging.css" />
		<style>
			.journalInstruct {
				width: 96%;
				height: 80%;
				margin: auto;
			}
			
			.journalInstruct_header {
				width: 100%;
				height: 45px;
			}
			
			.header_div {
				display: inline-block;
				width: 270px;
				text-align: left;
			}
			
			.journalInstruct_header_b {
				height: 30px;
				padding-top: 10px;
				padding-bottom: 5px;
			}
			
			.journalInstruct_manipulate {
				width: 170px;
				height: 30px;
				border-radius: 10px;
				text-align: center;
				line-height: 1.8;
				font-size: 16px;
				background: #ebeef0;
				border: 1px solid rgb(153, 153, 153);
				margin-bottom: 5px;
			}
			
			.journalInstruct_manipulate div {
				display: inline-block;
				width: 78px;
				height: 30px;
				cursor: pointer;
			}
			
			.manage_content_header_div {
				width: 160px;
				padding-top: 10px;
				height: 20px;
				text-align: left;
			}
			
			button {
				width: 70px;
				height: 25px;
				background: #458bff;
				border: #458bff;
				cursor: pointer;
				color: white;
			}
		</style>
	</head>

	<body>
		<div class="tails"></div>
		<div class="tailsa">
			<div class="tailsa-header">推送详细情况
				<div class="tailsa-header-x">X</div>
			</div>
			<div class="spinner">
				<div class="spinner-container container1">
					<div class="circle1"></div>
					<div class="circle2"></div>
					<div class="circle3"></div>
					<div class="circle4"></div>
				</div>
				<div class="spinner-container container2">
					<div class="circle1"></div>
					<div class="circle2"></div>
					<div class="circle3"></div>
					<div class="circle4"></div>
				</div>
				<div class="spinner-container container3">
					<div class="circle1"></div>
					<div class="circle2"></div>
					<div class="circle3"></div>
					<div class="circle4"></div>
				</div>
			</div>
			<div class="tailsa-content">
				<div class="tailsa_left ">推送标题:</div>
				<div class="tailsa_right pushTitle"></div>
			</div>
			<div class="tailsa-content">
				<div class="tailsa_left">
					<div>推送内容:</div>
				</div>
				<div class="tailsa_right pushMessage"></div>
			</div>
			<div class="tailsa-content">
				<div class="tailsa_left">推送机型:</div>
				<div class="tailsa_right pushDevice"></div>
			</div>
			<div class="tailsa-content">
				<div class="tailsa_left">推送时间:</div>
				<div class="tailsa_right  createdTime"></div>
			</div>
			<div class="tailsa-content">
				<div class="tailsa_left">创建人:</div>
				<div class="tailsa_right createdBy"></div>
			</div>

		</div>
		<div class="manage_header">
			<div>日志管理 </div>
			<img src="img/than.png" alt="" />
			<a href="journalInstruct.jsp">推送管理</a>
		</div>
		<div class="journalInstruct">
			<div class="journalInstruct_header">

				<div class="journalInstruct_header_b">

					<div class="header_div">
						<span>推送机型:</span>
						<select name="" id="ert" class="date_picker">
							<option value="0">请选择</option>
							<option value="1">全部</option>
						</select>
					</div>
					<button onclick="inquiry()">查询</button>
					<button onclick="load()">清除</button>
				</div>

			</div>
			<div class="journalInstruct_manipulate">
				<div onclick="PropellingMovementRegister()">增加</div>
				<div onclick="PropellingMovementAmend()">详情</div>
				<!--				<div onclick="managedelect()">删除</div>-->
			</div>
			<div class="userParameter_content_header">
				<div onclick="checkInput()" class="content_input_a">
					<div class=" tick  ">√</div>
				</div>
				<div class="userParameter_content_header_div">推送标题</div>
				<div class="userParameter_content_header_div">推送内容</div>

				<div class="userParameter_content_header_div">推送机型</div>
				<div class="userParameter_content_header_div">创建时间</div>
				<div class="userParameter_content_header_div">创建人</div>
			</div>
			<div id="pageTool">
				<div class="pageParameter" style="min-height: 410px;"></div>
				<!--<div ondblclick="ondblInput()" class="manage_content_content">
					<div onclick="checkInputA(this)" class="content_input_b" id="0">
						<div id="tick_0" class="tick">√</div>
					</div>
					<div class="manage_content_header_div">admin</div>
					<div class="manage_content_header_div">深圳优博讯</div>
					<div class="manage_content_header_div">超级管理员</div>
					<div class="manage_content_header_div">13456@qq.com</div>
					<div class="manage_content_header_div">13422266666</div>
					<div class="manage_content_header_div">管理员</div>
					<div class="manage_content_header_div">2017-07-06 00:00:00</div>
					<div class="manage_content_header_div">2017-07-06 00:00:00</div>
					<div class="manage_content_header_div">2017-07-06 00:00:00</div>
				</div>-->
				<div class="pageParametera"></div>
			</div>
		</div>

		<script src="js/jq.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/jQuery.Cookie.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript" src="js/query.js"></script>
		<script type="text/javascript" src="js/paging.js"></script>
		<script type="text/javascript">
			function inquiry() {
				var token = $("#ert").val();
				var param;
				if(token == 0 || token == 1) {
					param = {
						index: 0,
						page: 10,
					}
				} else {
					param = {
						index: 0,
						page: 10,
						type: 1,
						deviceToken: token,
					}
				}
				$.ajax({
					url: 'pushMessageList',
					type: 'POST',
					data: param,
					dataType: 'json',
					success: function(data) {
						if(data.errorCode == 0) {
							tickId = 0;
							tickaId = '';
							somearray = [];
							$(".pageParameter").html("")
							$(".pageParametera").html("")
							$.each(data.result.pushList, function(i, value) {
								for(var j = 0; j < assd.length; j++) {
									if(assd[j].dvcToken == "") {} else {
										if(assd[j].dvcToken == value.pushDevice) {
											if(i % 2 == 0) {
												var nDate = new Date(value.createdTime); //直接将毫秒数当参数传进去。
												var month = nDate.getMonth() + 1;
												var year = nDate.getFullYear() + '-' + month + '-' + nDate.getDate() + " " + nDate.getHours() + ':' + nDate.getMinutes() + ':' + nDate.getSeconds();
												error_tpl = '<div class="userParameter_content_contenta"><div onclick="checkInputA(this)" class="content_input_b" id="' + value.id + '"> <div id="tick_' + value.id + '" class="tick">√</div> </div><div class="userParameter_content_header_div">' + value.pushTitle + '</div> <div class="userParameter_content_header_div manage_content_header_div_four">' + value.pushMessage + '</div> <div  class="userParameter_content_header_div manage_content_header_div_four">' + assd[j].dvcId + '</div><div class="userParameter_content_header_div">' + year + '</div> <div class="userParameter_content_header_div">' + value.createdBy + '</div> </div>'
												$(".pageParameter").append(error_tpl);
											} else {
												var nDate = new Date(value.createdTime); //直接将毫秒数当参数传进去。
												var month = nDate.getMonth() + 1;
												var year = nDate.getFullYear() + '-' + month + '-' + nDate.getDate() + " " + nDate.getHours() + ':' + nDate.getMinutes() + ':' + nDate.getSeconds();
												error_tpl = '<div class="userParameter_content_content"><div onclick="checkInputA(this)" class="content_input_b" id="' + value.id + '"> <div id="tick_' + value.id + '" class="tick">√</div> </div><div class="userParameter_content_header_div">' + value.pushTitle + '</div> <div class="userParameter_content_header_div manage_content_header_div_four">' + value.pushMessage + '</div> <div  class="userParameter_content_header_div manage_content_header_div_four">' + assd[j].dvcId + '</div><div class="userParameter_content_header_div">' + year + '</div> <div class="userParameter_content_header_div">' + value.createdBy + '</div> </div>'
												$(".pageParameter").append(error_tpl);
											}

										} else {
											if(i % 2 == 0) {
												var nDate = new Date(value.createdTime); //直接将毫秒数当参数传进去。
												var month = nDate.getMonth() + 1;
												var year = nDate.getFullYear() + '-' + month + '-' + nDate.getDate() + " " + nDate.getHours() + ':' + nDate.getMinutes() + ':' + nDate.getSeconds();
												error_tpl = '<div class="userParameter_content_contenta"><div onclick="checkInputA(this)" class="content_input_b" id="' + value.id + '"> <div id="tick_' + value.id + '" class="tick">√</div> </div><div class="userParameter_content_header_div">' + value.pushTitle + '</div> <div class="userParameter_content_header_div manage_content_header_div_four">' + value.pushMessage + '</div> <div  class="userParameter_content_header_div manage_content_header_div_four">全部</div><div class="userParameter_content_header_div">' + year + '</div> <div class="userParameter_content_header_div">' + value.createdBy + '</div> </div>'
												$(".pageParameter").append(error_tpl);
											} else {
												var nDate = new Date(value.createdTime); //直接将毫秒数当参数传进去。
												var month = nDate.getMonth() + 1;
												var year = nDate.getFullYear() + '-' + month + '-' + nDate.getDate() + " " + nDate.getHours() + ':' + nDate.getMinutes() + ':' + nDate.getSeconds();
												error_tpl = '<div class="userParameter_content_content"><div onclick="checkInputA(this)" class="content_input_b" id="' + value.id + '"> <div id="tick_' + value.id + '" class="tick">√</div> </div><div class="userParameter_content_header_div">' + value.pushTitle + '</div> <div class="userParameter_content_header_div manage_content_header_div_four">' + value.pushMessage + '</div> <div  class="userParameter_content_header_div manage_content_header_div_four">全部</div><div class="userParameter_content_header_div">' + year + '</div> <div class="userParameter_content_header_div">' + value.createdBy + '</div> </div>'
												$(".pageParameter").append(error_tpl);
											}

										}
									}
								}

							})
							$('.pageParametera').Paging({
								pagesize: 10,
								count: data.result.count,
								toolbar: true,
								callback: function(page, size, count) {
									$(".pageParameter").html("");
									if(token == 0 || token == 1) {
										param = {
											index: page - 1,
											page: 10,
										}
									} else {
										param = {
											index: page - 1,
											page: 10,
											type: 1,
											deviceToken: token,
										}
									}
									$.ajax({
										url: 'pushMessageList',
										type: 'POST',
										data: param,
										dataType: 'json',
										success: function(data) {
											tickId = 0;
											tickaId = '';
											somearray = [];
											$.each(data.result.pushList, function(i, value) {
												for(var j = 0; j < assd.length; j++) {
													if(assd[j].dvcToken == "") {} else {
														if(assd[j].dvcToken == value.pushDevice) {
															if(i % 2 == 0) {
																var nDate = new Date(value.createdTime); //直接将毫秒数当参数传进去。
																var month = nDate.getMonth() + 1;
																var year = nDate.getFullYear() + '-' + month + '-' + nDate.getDate() + " " + nDate.getHours() + ':' + nDate.getMinutes() + ':' + nDate.getSeconds();
																error_tpl = '<div class="userParameter_content_contenta"><div onclick="checkInputA(this)" class="content_input_b" id="' + value.id + '"> <div id="tick_' + value.id + '" class="tick">√</div> </div><div class="userParameter_content_header_div">' + value.pushTitle + '</div> <div class="userParameter_content_header_div manage_content_header_div_four">' + value.pushMessage + '</div> <div  class="userParameter_content_header_div manage_content_header_div_four">' + assd[j].dvcId + '</div><div class="userParameter_content_header_div">' + year + '</div> <div class="userParameter_content_header_div">' + value.createdBy + '</div> </div>'
																$(".pageParameter").append(error_tpl);
															} else {
																var nDate = new Date(value.createdTime); //直接将毫秒数当参数传进去。
																var month = nDate.getMonth() + 1;
																var year = nDate.getFullYear() + '-' + month + '-' + nDate.getDate() + " " + nDate.getHours() + ':' + nDate.getMinutes() + ':' + nDate.getSeconds();
																error_tpl = '<div class="userParameter_content_content"><div onclick="checkInputA(this)" class="content_input_b" id="' + value.id + '"> <div id="tick_' + value.id + '" class="tick">√</div> </div><div class="userParameter_content_header_div">' + value.pushTitle + '</div> <div class="userParameter_content_header_div manage_content_header_div_four">' + value.pushMessage + '</div> <div  class="userParameter_content_header_div manage_content_header_div_four">' + assd[j].dvcId + '</div><div class="userParameter_content_header_div">' + year + '</div> <div class="userParameter_content_header_div">' + value.createdBy + '</div> </div>'
																$(".pageParameter").append(error_tpl);
															}
														} else {
															if(i % 2 == 0) {
																var nDate = new Date(value.createdTime); //直接将毫秒数当参数传进去。
																var month = nDate.getMonth() + 1;
																var year = nDate.getFullYear() + '-' + month + '-' + nDate.getDate() + " " + nDate.getHours() + ':' + nDate.getMinutes() + ':' + nDate.getSeconds();
																error_tpl = '<div class="userParameter_content_contenta"><div onclick="checkInputA(this)" class="content_input_b" id="' + value.id + '"> <div id="tick_' + value.id + '" class="tick">√</div> </div><div class="userParameter_content_header_div">' + value.pushTitle + '</div> <div class="userParameter_content_header_div manage_content_header_div_four">' + value.pushMessage + '</div> <div  class="userParameter_content_header_div manage_content_header_div_four">全部</div><div class="userParameter_content_header_div">' + year + '</div> <div class="userParameter_content_header_div">' + value.createdBy + '</div> </div>'
																$(".pageParameter").append(error_tpl);
															} else {
																var nDate = new Date(value.createdTime); //直接将毫秒数当参数传进去。
																var month = nDate.getMonth() + 1;
																var year = nDate.getFullYear() + '-' + month + '-' + nDate.getDate() + " " + nDate.getHours() + ':' + nDate.getMinutes() + ':' + nDate.getSeconds();
																error_tpl = '<div class="userParameter_content_content"><div onclick="checkInputA(this)" class="content_input_b" id="' + value.id + '"> <div id="tick_' + value.id + '" class="tick">√</div> </div><div class="userParameter_content_header_div">' + value.pushTitle + '</div> <div class="userParameter_content_header_div manage_content_header_div_four">' + value.pushMessage + '</div> <div  class="userParameter_content_header_div manage_content_header_div_four">全部</div><div class="userParameter_content_header_div">' + year + '</div> <div class="userParameter_content_header_div">' + value.createdBy + '</div> </div>'
																$(".pageParameter").append(error_tpl);
															}

														}
													}
												}
											})
										},
										error: function(err) {
											alert("连接服务器失败！请重新提交！");
											top.location.href = 'index.jsp';
										}
									});
								}
							})
						} else if(data.errorCode == -6) {
							alert("登录超时！");
							top.location.href = 'index.jsp';
						} else {
							alert("请重试！");
						}
					},
					error: function(err) {
						alert("连接服务器失败！请重新提交！");
						top.location.href = 'index.jsp';
					}
				});

			}

			var assd;
			var ticklength;
			var idtick = []; //			全体打钩
			function checkInput() {
				var tick = $(".tick").css("display");
				if(tick == "none") {
					$(".tick").show();
					tickId = ticklength;
					tickaId = somearray[0];
					somearray = idtick;
				} else if(tick == "block") {
					$(".tick").hide();
					$(".tick").hide();
					$(".tick_block ").hide();
					tickId = 0;
					somearray = [];
					tickaId = somearray[0];
				}
			}
			//			单独打钩
			var tickId = 0;
			var tickaId = '';
			var somearray = []

			function removeByValue(arr, val) {
				for(var i = 0; i < arr.length; i++) {
					if(arr[i] == val) {
						arr.splice(i, 1);
						break;
					}
				}
			}

			function checkInputA(data) {
				var ticka = "tick_" + data.id
				var tickBlock = document.getElementById(ticka);
				if(tickBlock.style.display == "block") {
					tickBlock.style.display = "none";
					removeByValue(somearray, data.id);
					tickId = tickId - 1;
					tickaId = somearray[0];
				} else if(tickBlock.style.display == "" || tickBlock.style.display == "none") {
					tickBlock.style.display = "block";
					removeByValue(somearray, data.id);
					somearray.push(data.id);
					tickaId = somearray[0];
					tickId = tickId + 1;
				}

			}

			function PropellingMovementAmend() {
				if(tickId == 0) {
					alert("请选择你要编辑的记录！")
				} else if(tickId == 1) {
					for(var j = 0; j < paramajax.length; j++) {
						if(paramajax[j].id == tickaId) {
							if(paramajax[j].pushDevice == "") {
								$(".pushDevice").text('全部');
							} else {
								for(var k = 0; k < assd.length; k++) {
									if(assd[k].dvcToken == "") {} else {
										if(assd[k].dvcToken == paramajax[j].pushDevice) {
											$(".pushDevice").text(assd[k].dvcId);

										}
									}

								}
							}
							var nDate = new Date(paramajax[j].createdTime); //直接将毫秒数当参数传进去。
							var month = nDate.getMonth() + 1;
							var year = nDate.getFullYear() + '-' + month + '-' + nDate.getDate() + " " + nDate.getHours() + ':' + nDate.getMinutes() + ':' + nDate.getSeconds();
							$(".spinner").show();
							$(".pushTitle").text(paramajax[j].pushTitle);
							$(".pushMessage").text(paramajax[j].pushMessage);
							$(".createdTime").text(year);

							$(".createdBy").text(paramajax[j].createdBy);

							$(".spinner").hide();

							$(".tails").show();
							$(".tailsa").show();
							$(".tailsa-content").show();

						}

					}

					//					window.location.href = 'userParameterRevisejsp.jsp';
				} else if(tickId > 1) {
					alert("一次只能编辑一条记录！")
				} else {
					alert(tickId)

				}
			}

			function load() {

				var x = document.getElementById("ert");
				x.selectedIndex = 0;
				$(".pageParameter").html("")
				$(".pageParametera").html("")

				$.ajax({
					url: 'pushMessageList',
					type: 'POST',
					data: {
						index: 0,
						page: 10
					},
					dataType: 'json',
					success: function(data) {
						if(data.errorCode == 0) {
							paramajax = data.result.pushList;
							$.each(data.result.pushList, function(i, value) {
								for(var j = 0; j < assd.length; j++) {
									if(assd[j].dvcToken == "") {} else {
										if(assd[j].dvcToken == value.pushDevice) {
											var nDate = new Date(value.createdTime); //直接将毫秒数当参数传进去。
											var month = nDate.getMonth() + 1;
											var year = nDate.getFullYear() + '-' + month + '-' + nDate.getDate() + " " + nDate.getHours() + ':' + nDate.getMinutes() + ':' + nDate.getSeconds();

											if(i % 2 == 0) {
												error_tpl = '<div class="userParameter_content_contenta"><div onclick="checkInputA(this)" class="content_input_b" id="' + value.id + '"> <div id="tick_' + value.id + '" class="tick">√</div> </div><div class="userParameter_content_header_div">' + value.pushTitle + '</div> <div class="userParameter_content_header_div manage_content_header_div_four">' + value.pushMessage + '</div> <div  class="userParameter_content_header_div manage_content_header_div_four">' + assd[j].dvcId + '</div><div class="userParameter_content_header_div">' + year + '</div> <div class="userParameter_content_header_div">' + value.createdBy + '</div> </div>'
												$(".pageParameter").append(error_tpl);
											} else {
												error_tpl = '<div class="userParameter_content_content"><div onclick="checkInputA(this)" class="content_input_b" id="' + value.id + '"> <div id="tick_' + value.id + '" class="tick">√</div> </div><div class="userParameter_content_header_div">' + value.pushTitle + '</div> <div class="userParameter_content_header_div manage_content_header_div_four">' + value.pushMessage + '</div> <div  class="userParameter_content_header_div manage_content_header_div_four">' + assd[j].dvcId + '</div><div class="userParameter_content_header_div">' + year + '</div> <div class="userParameter_content_header_div">' + value.createdBy + '</div> </div>'
												$(".pageParameter").append(error_tpl);
											}

										} else {
											var nDate = new Date(value.createdTime); //直接将毫秒数当参数传进去。
											var month = nDate.getMonth() + 1;
											var year = nDate.getFullYear() + '-' + month + '-' + nDate.getDate() + " " + nDate.getHours() + ':' + nDate.getMinutes() + ':' + nDate.getSeconds();
											if(i % 2 == 0) {
												error_tpl = '<div class="userParameter_content_contenta"><div onclick="checkInputA(this)" class="content_input_b" id="' + value.id + '"> <div id="tick_' + value.id + '" class="tick">√</div> </div><div class="userParameter_content_header_div">' + value.pushTitle + '</div> <div class="userParameter_content_header_div manage_content_header_div_four">' + value.pushMessage + '</div> <div  class="userParameter_content_header_div manage_content_header_div_four">全部</div><div class="userParameter_content_header_div">' + year + '</div> <div class="userParameter_content_header_div">' + value.createdBy + '</div> </div>'
												$(".pageParameter").append(error_tpl);
											} else {
												error_tpl = '<div class="userParameter_content_content"><div onclick="checkInputA(this)" class="content_input_b" id="' + value.id + '"> <div id="tick_' + value.id + '" class="tick">√</div> </div><div class="userParameter_content_header_div">' + value.pushTitle + '</div> <div class="userParameter_content_header_div manage_content_header_div_four">' + value.pushMessage + '</div> <div  class="userParameter_content_header_div manage_content_header_div_four">全部</div><div class="userParameter_content_header_div">' + year + '</div> <div class="userParameter_content_header_div">' + value.createdBy + '</div> </div>'
												$(".pageParameter").append(error_tpl);
											}

										}
									}
								}

							})

							$('.pageParametera').Paging({
								pagesize: 10,
								count: data.result.count,
								toolbar: true,
								callback: function(page, size, count) {
									$(".pageParameter").html("")
									$.ajax({
										url: 'pushMessageList',
										type: 'POST',
										data: {
											index: page - 1,
											page: 10
										},
										dataType: 'json',
										success: function(data) {
											paramajax = data.result.pushList;
											tickId = 0;
											tickaId = '';
											somearray = [];
											$.each(data.result.pushList, function(i, value) {
												for(var j = 0; j < assd.length; j++) {
													if(assd[j].dvcToken == "") {} else {
														if(assd[j].dvcToken == value.pushDevice) {
															var nDate = new Date(value.createdTime); //直接将毫秒数当参数传进去。
															var month = nDate.getMonth() + 1;
															var year = nDate.getFullYear() + '-' + month + '-' + nDate.getDate() + " " + nDate.getHours() + ':' + nDate.getMinutes() + ':' + nDate.getSeconds();
															if(i % 2 == 0) {
																error_tpl = '<div class="userParameter_content_contenta"><div onclick="checkInputA(this)" class="content_input_b" id="' + value.id + '"> <div id="tick_' + value.id + '" class="tick">√</div> </div><div class="userParameter_content_header_div">' + value.pushTitle + '</div> <div class="userParameter_content_header_div manage_content_header_div_four">' + value.pushMessage + '</div> <div  class="userParameter_content_header_div manage_content_header_div_four">' + assd[j].dvcId + '</div><div class="userParameter_content_header_div">' +year + '</div> <div class="userParameter_content_header_div">' + value.createdBy + '</div> </div>'
																$(".pageParameter").append(error_tpl);
															} else {
																error_tpl = '<div class="userParameter_content_content"><div onclick="checkInputA(this)" class="content_input_b" id="' + value.id + '"> <div id="tick_' + value.id + '" class="tick">√</div> </div><div class="userParameter_content_header_div">' + value.pushTitle + '</div> <div class="userParameter_content_header_div manage_content_header_div_four">' + value.pushMessage + '</div> <div  class="userParameter_content_header_div manage_content_header_div_four">' + assd[j].dvcId + '</div><div class="userParameter_content_header_div">' + year + '</div> <div class="userParameter_content_header_div">' + value.createdBy + '</div> </div>'
																$(".pageParameter").append(error_tpl);
															}

														} else {
															var nDate = new Date(value.createdTime); //直接将毫秒数当参数传进去。
															var month = nDate.getMonth() + 1;
															var year = nDate.getFullYear() + '-' + month + '-' + nDate.getDate() + " " + nDate.getHours() + ':' + nDate.getMinutes() + ':' + nDate.getSeconds();
															if(i % 2 == 0) {
																error_tpl = '<div class="userParameter_content_contenta"><div onclick="checkInputA(this)" class="content_input_b" id="' + value.id + '"> <div id="tick_' + value.id + '" class="tick">√</div> </div><div class="userParameter_content_header_div">' + value.pushTitle + '</div> <div class="userParameter_content_header_div manage_content_header_div_four">' + value.pushMessage + '</div> <div  class="userParameter_content_header_div manage_content_header_div_four">全部</div><div class="userParameter_content_header_div">' +year+ '</div> <div class="userParameter_content_header_div">' + value.createdBy + '</div> </div>'
																$(".pageParameter").append(error_tpl);
															} else {
																error_tpl = '<div class="userParameter_content_content"><div onclick="checkInputA(this)" class="content_input_b" id="' + value.id + '"> <div id="tick_' + value.id + '" class="tick">√</div> </div><div class="userParameter_content_header_div">' + value.pushTitle + '</div> <div class="userParameter_content_header_div manage_content_header_div_four">' + value.pushMessage + '</div> <div  class="userParameter_content_header_div manage_content_header_div_four">全部</div><div class="userParameter_content_header_div">' + year + '</div> <div class="userParameter_content_header_div">' + value.createdBy + '</div> </div>'
																$(".pageParameter").append(error_tpl);
															}

														}
													}
												}

											})

										},
										error: function(err) {
											alert("连接服务器失败！请重新提交！");
											top.location.href = 'index.jsp';
										}
									});
								}

							})
						} else if(data.errorCode == -6) {
							alert("登录超时！");
							top.location.href = 'index.jsp';
						} else {
							alert("请重试！");
						}
					},
					error: function(err) {
						alert("连接服务器失败！请重新提交！");
						top.location.href = 'index.jsp';
					}
				});

			}

			function PropellingMovementRegister() {
				window.location.href = 'journalPropellingMovementAdd.jsp';
			}
			$(".tailsa-header-x").click(function() {
				$(".tails").hide();
				$(".tailsa").hide();
			});
			var paramajax;
			$.ajax({
				url: 'dvcList',
				type: 'POST',
				data: {
					companyId: $.Cookie("companyId"),
					session: $.Cookie("session"),
					userId: $.Cookie("userId"),
					orgId: 1,
					index: 0,
					page: 60
				},
				dataType: 'json',
				success: function(data) {
					if(data.errorCode == 0) {
						$.each(data.result.dvcList, function(i, value) {
							if(data.result.dvcList[i].dvcToken == "") {} else {
								error_tpl = '<option value="' + data.result.dvcList[i].dvcToken + '">' + data.result.dvcList[i].dvcId + '</option>"'
								$("#ert").append(error_tpl);
							}
						});
						assd = data.result.dvcList;

						$.ajax({
							url: 'pushMessageList',
							type: 'POST',
							data: {
								index: 0,
								page: 10
							},
							dataType: 'json',
							success: function(data) {

								if(data.errorCode == 0) {
									paramajax = data.result.pushList;
									$.each(data.result.pushList, function(i, value) {
										for(var j = 0; j < assd.length; j++) {
											if(assd[j].dvcToken == "") {} else {
												if(assd[j].dvcToken == value.pushDevice) {
													var nDate = new Date(value.createdTime); //直接将毫秒数当参数传进去。
													var month = nDate.getMonth() + 1;
													var year = nDate.getFullYear() + '-' + month + '-' + nDate.getDate() + " " + nDate.getHours() + ':' + nDate.getMinutes() + ':' + nDate.getSeconds();

													if(i % 2 == 0) {
														error_tpl = '<div class="userParameter_content_contenta"><div onclick="checkInputA(this)" class="content_input_b" id="' + value.id + '"> <div id="tick_' + value.id + '" class="tick">√</div> </div><div class="userParameter_content_header_div">' + value.pushTitle + '</div> <div class="userParameter_content_header_div manage_content_header_div_four">' + value.pushMessage + '</div> <div  class="userParameter_content_header_div manage_content_header_div_four">' + assd[j].dvcId + '</div><div class="userParameter_content_header_div">' + year + '</div> <div class="userParameter_content_header_div">' + value.createdBy + '</div> </div>'
														$(".pageParameter").append(error_tpl);
													} else {
														error_tpl = '<div class="userParameter_content_content"><div onclick="checkInputA(this)" class="content_input_b" id="' + value.id + '"> <div id="tick_' + value.id + '" class="tick">√</div> </div><div class="userParameter_content_header_div">' + value.pushTitle + '</div> <div class="userParameter_content_header_div manage_content_header_div_four">' + value.pushMessage + '</div> <div  class="userParameter_content_header_div manage_content_header_div_four">' + assd[j].dvcId + '</div><div class="userParameter_content_header_div">' + year + '</div> <div class="userParameter_content_header_div">' + value.createdBy + '</div> </div>'
														$(".pageParameter").append(error_tpl);
													}

												} else {
													var nDate = new Date(value.createdTime); //直接将毫秒数当参数传进去。
													var month = nDate.getMonth() + 1;
													var year = nDate.getFullYear() + '-' + month + '-' + nDate.getDate() + " " + nDate.getHours() + ':' + nDate.getMinutes() + ':' + nDate.getSeconds();
													if(i % 2 == 0) {
														error_tpl = '<div class="userParameter_content_contenta"><div onclick="checkInputA(this)" class="content_input_b" id="' + value.id + '"> <div id="tick_' + value.id + '" class="tick">√</div> </div><div class="userParameter_content_header_div">' + value.pushTitle + '</div> <div class="userParameter_content_header_div manage_content_header_div_four">' + value.pushMessage + '</div> <div  class="userParameter_content_header_div manage_content_header_div_four">全部</div><div class="userParameter_content_header_div">' + year + '</div> <div class="userParameter_content_header_div">' + value.createdBy + '</div> </div>'
														$(".pageParameter").append(error_tpl);
													} else {
														error_tpl = '<div class="userParameter_content_content"><div onclick="checkInputA(this)" class="content_input_b" id="' + value.id + '"> <div id="tick_' + value.id + '" class="tick">√</div> </div><div class="userParameter_content_header_div">' + value.pushTitle + '</div> <div class="userParameter_content_header_div manage_content_header_div_four">' + value.pushMessage + '</div> <div  class="userParameter_content_header_div manage_content_header_div_four">全部</div><div class="userParameter_content_header_div">' + year + '</div> <div class="userParameter_content_header_div">' + value.createdBy + '</div> </div>'
														$(".pageParameter").append(error_tpl);
													}

												}
											}
										}

									})

									$('.pageParametera').Paging({
										pagesize: 10,
										count: data.result.count,
										toolbar: true,
										callback: function(page, size, count) {
											$(".pageParameter").html("")
											$.ajax({
												url: 'pushMessageList',
												type: 'POST',
												data: {
													index: page - 1,
													page: 10
												},
												dataType: 'json',
												success: function(data) {
													paramajax = data.result.pushList;
													tickId = 0;
													tickaId = '';
													somearray = [];
													$.each(data.result.pushList, function(i, value) {
														for(var j = 0; j < assd.length; j++) {
															if(assd[j].dvcToken == "") {} else {
																if(assd[j].dvcToken == value.pushDevice) {
																	if(i % 2 == 0) {
																		error_tpl = '<div class="userParameter_content_contenta"><div onclick="checkInputA(this)" class="content_input_b" id="' + value.id + '"> <div id="tick_' + value.id + '" class="tick">√</div> </div><div class="userParameter_content_header_div">' + value.pushTitle + '</div> <div class="userParameter_content_header_div manage_content_header_div_four">' + value.pushMessage + '</div> <div  class="userParameter_content_header_div manage_content_header_div_four">' + assd[j].dvcId + '</div><div class="userParameter_content_header_div">' + value.createdTime + '</div> <div class="userParameter_content_header_div">' + value.createdBy + '</div> </div>'
																		$(".pageParameter").append(error_tpl);
																	} else {
																		error_tpl = '<div class="userParameter_content_content"><div onclick="checkInputA(this)" class="content_input_b" id="' + value.id + '"> <div id="tick_' + value.id + '" class="tick">√</div> </div><div class="userParameter_content_header_div">' + value.pushTitle + '</div> <div class="userParameter_content_header_div manage_content_header_div_four">' + value.pushMessage + '</div> <div  class="userParameter_content_header_div manage_content_header_div_four">' + assd[j].dvcId + '</div><div class="userParameter_content_header_div">' + value.createdTime + '</div> <div class="userParameter_content_header_div">' + value.createdBy + '</div> </div>'
																		$(".pageParameter").append(error_tpl);
																	}

																} else {
																	if(i % 2 == 0) {
																		error_tpl = '<div class="userParameter_content_contenta"><div onclick="checkInputA(this)" class="content_input_b" id="' + value.id + '"> <div id="tick_' + value.id + '" class="tick">√</div> </div><div class="userParameter_content_header_div">' + value.pushTitle + '</div> <div class="userParameter_content_header_div manage_content_header_div_four">' + value.pushMessage + '</div> <div  class="userParameter_content_header_div manage_content_header_div_four">全部</div><div class="userParameter_content_header_div">' + value.createdTime + '</div> <div class="userParameter_content_header_div">' + value.createdBy + '</div> </div>'
																		$(".pageParameter").append(error_tpl);
																	} else {
																		error_tpl = '<div class="userParameter_content_content"><div onclick="checkInputA(this)" class="content_input_b" id="' + value.id + '"> <div id="tick_' + value.id + '" class="tick">√</div> </div><div class="userParameter_content_header_div">' + value.pushTitle + '</div> <div class="userParameter_content_header_div manage_content_header_div_four">' + value.pushMessage + '</div> <div  class="userParameter_content_header_div manage_content_header_div_four">全部</div><div class="userParameter_content_header_div">' + value.createdTime + '</div> <div class="userParameter_content_header_div">' + value.createdBy + '</div> </div>'
																		$(".pageParameter").append(error_tpl);
																	}

																}
															}
														}

													})

												},
												error: function(err) {
													alert("连接服务器失败！请重新提交！");
													top.location.href = 'index.jsp';
												}
											});
										}

									})
								} else if(data.errorCode == -6) {
									alert("登录超时！");
									top.location.href = 'index.jsp';
								} else {
									alert("请重试！");
								}
							},
							error: function(err) {
								alert("连接服务器失败！请重新提交！");
								top.location.href = 'index.jsp';
							}
						});
					} else if(data.errorCode == -6) {
						alert("登录超时！");
						top.location.href = 'index.jsp';
					} else {
						alert("请重试！");
					}
				},
				error: function(err) {
					alert("连接服务器失败！请重新提交！");
					top.location.href = 'index.jsp';
				}
			});

			autodivheight();

			function autodivheight() { //函数：获取尺寸
				//获取浏览器窗口高度
				var winHeight = 0;
				if(window.innerHeight)
					winHeight = window.innerHeight;
				else if((document.body) && (document.body.clientHeight))
					winHeight = document.body.clientHeight;
				//通过深入Document内部对body进行检测，获取浏览器窗口高度
				if(document.documentElement && document.documentElement.clientHeight)
					winHeight = document.documentElement.clientHeight;
				//DIV高度为浏览器窗口的高度

				a = winHeight - 200;
				if(a < 0) {
					a = 0
					$(".pageParameter").css("height", a);
					//		$(".pageTool").css("min-height", 410);

				} else {
					$(".pageParameter").css("height", a);
					//		$(".pageTool").css("min-height", 410);

				}

				//				document.getElementById("test").style.height = winHeight / 2 + "px";
			}
			window.onresize = autodivheight; //浏览器窗口发生变化时同时变化DIV高度
		</script>
	</body>

</html>